<!--  -->
<template>
  <div>
  我是子页面
  {{counter}}
  <el-button type="primary" @click="increament(1)">
      增加
  </el-button>
   <el-button type="primary" @click="increament(-1)">
      减少
  </el-button>
  </div>
</template>

<script>
export default {
  name:'CounterView',
  props:{
    counter:{
      type:Number,
      default:500
      
    }
  },
  setup (prop,ctx) {
    console.log(prop, ctx)
      const increament = (num) =>{
        ctx.emit('onIncreament',num)
      }


    return {
           increament
        }

      }
  }
 

</script>
<style lang='scss' scoped>
</style>